import time
import requests

# 执行状态码
my_status_code = 0

# 贵州地址
# my_html = "https://gzjk.ejclims.com/#/login"
# 登陆地址
my_login_url = "https://ssodev.ejclims.com//service/external/getUserByNamePwdLims"

# 用户信息
my_play = {
  "name": "admin_lims_gzjk",
  "pwd": "1qaz@WSX3edc",
  "level": "1"
}
try:
    with requests.Session() as session:
        # 请求贵州疾控地址
        req = requests.post(my_login_url, data=my_play, verify=False)
        cookies = req.cookies
        print("cookies = ",cookies)
        print(req.json())
        # 判断请求是否成功
        if req.status_code == 200:
            print("请求成功")
            my_status_code = 1
        else:
            print("请求失败")
            my_status_code = 0

except requests.RequestException as e:
    print("请求发生错误：", e)

# 等待3秒
time.sleep(3)
req.close()
